package coo.exception;

public class Student {
    private String name;
    private String sex;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) throws Exception {
        if("男".equals(sex)||"女".equals(sex)){
            this.sex = sex;
        }else{
            throw new Exception("性别错误");
        }

    }
}
